package com.ruoyi.user.mapper;

import java.math.BigDecimal;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.user.domain.UserTotalCapital;

/**
 * 资金余额Mapper接口
 * 
 * @author DEREK
 * @date 2023-05-22
 */
public interface UserTotalCapitalMapper extends BaseMapper<UserTotalCapital>
{
	/**
	 * 查询资金余额
	 * 
	 * @param id 资金余额主键
	 * @return 资金余额
	 */
	public UserTotalCapital selectUserTotalCapitalById(Long id);

	/**
	 * 查询资金余额列表
	 * 
	 * @param userTotalCapital 资金余额
	 * @return 资金余额集合
	 */
	public List<UserTotalCapital> selectUserTotalCapitalList(UserTotalCapital userTotalCapital);

	/**
	 * 新增资金余额
	 * 
	 * @param userTotalCapital 资金余额
	 * @return 结果
	 */
	public int insertUserTotalCapital(UserTotalCapital userTotalCapital);

	/**
	 * 修改资金余额
	 * 
	 * @param userTotalCapital 资金余额
	 * @return 结果
	 */
	public int updateUserTotalCapital(UserTotalCapital userTotalCapital);

	/**
	 * 删除资金余额
	 * 
	 * @param id 资金余额主键
	 * @return 结果
	 */
	public int deleteUserTotalCapitalById(Long id);

	/**
	 * 批量删除资金余额
	 * 
	 * @param ids 需要删除的数据主键集合
	 * @return 结果
	 */
	public int deleteUserTotalCapitalByIds(Long[] ids);

	/**
	 * 	查询总金额
	 * @param type
	 * @param userId
	 * @return
	 */
	String getAmountByUserId(@Param("userId")Long userId);

	/**
	 * 修改用户余额
	 * @param amount		金额
	 * @param userId		用户ID
	 * @param type		1=通过 2=拒绝
	 */
	void updUserAmount(@Param("amount")BigDecimal amount, @Param("userId")Long userId,@Param("type")Integer type);
	
	/**
	 * 	待提现金额结算
	 */
	int settlementWithdrawalAmount();

}
